package com.foreknow.trains.train2;

public class ClassA implements InterfaceA {
    @Override
    public int method(int n) {
        int sum=0;
        for(int i=0;i<n;i++){
            sum+=i+1;
        }
        System.out.print("1到"+n+"的和为");
        return sum;
    }
}
